/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.router.core.repository.service;

import info.peigen.hotpot.business.router.core.repository.entity.RouterChannelEntity;
import info.peigen.hotpot.business.router.core.repository.mapper.RouterChannelMapper;
import info.peigen.hotpot.business.router.facade.enums.ChannelCode;
import info.peigen.hotpot.component.data.repository.beetlsql.service.AbstractBeetlSqlRepository;
import org.noear.solon.annotation.Component;

import java.util.List;

/**
 * <b>(RouterChannelRepository)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/5
 */
@Component
public class RouterChannelRepository extends AbstractBeetlSqlRepository<RouterChannelMapper, RouterChannelEntity> {

    public RouterChannelEntity findByChannelId(String channelId) {
        return mapper.findByChannelId(channelId);
    }

    public List<RouterChannelEntity> findByCode(ChannelCode code) {
        return mapper.createLambdaQuery().andEq("channel_code", code).select();
    }
}